package com.itheima.controller;

import com.itheima.common.R;
import com.itheima.entity.Category;
import com.itheima.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**分类管理接口
 * @author msi
 */
@RequestMapping("/category")
@RestController
public class CategoryControllerM {

    @Autowired
    private CategoryService service;

    @GetMapping("/list")
    public R<List<Category>> selectList(Integer type) {

        List<Category> list = service.selectList(type);

        return R.success(list);
    }
}
